var JSTableCtrl={

                addTR   :function (tbl){
                        var exampletr=tbl.rows[tbl.rows.length-1];
                        var tmp=tbl.insertRow(tbl.rows.length-1);
                        if (exampletr.className){
                          tmp.className=exampletr.className;
                        }

                        for (i=0;i<exampletr.cells.length; i++){
                          var celltmp=tmp.insertCell();
                          celltmp.className=exampletr.cells[i].className;
                          celltmp.innerHTML=exampletr.cells[i].innerHTML;
                        }

                        return true;
                      },

               addTRFromSrc :function (tblsrc,tbl)  {
                        var exampletr=tblsrc.rows[tblsrc.rows.length-1];
                        var tmp=tbl.insertRow(tbl.rows.length);
                        if (exampletr.className){
                          tmp.className=exampletr.className;
                        }

                        for (i=0;i<exampletr.cells.length; i++){
                          var celltmp=tmp.insertCell();
                          celltmp.className=exampletr.cells[i].className;
                          celltmp.innerHTML=exampletr.cells[i].innerHTML;
                        }

                        return true;

                      },

               deleteTR :function (table_sp,buttonid){
                     var pt=-1;
                     for (i=0;i<document.all(buttonid).length;i++){
                       if (document.all(buttonid)[i]==event.srcElement)pt=i;
                     }

                     if (pt>-1)table_sp.deleteRow(pt+1);

              },

              fieldContentMouseOver:  function (obj){
                        if (obj.className=="fieldContent" || obj.className=="linkMouseOut") obj.className="linkMouseHover";
                      },

              fieldContentMouseOut :  function (obj){
                        if (obj.className=="linkMouseHover" || obj.className=="fieldContent") obj.className="linkMouseOut";
                      },

              clickSelectTR  :        function (obj,trName,className){
                        if (className==null || className=="") className="clickSelect"; 
                        for (var i=0;document.all(trName) && i<document.all(trName).length;i++){
                          document.all(trName)[i].className="fieldContent";
                          if (obj==document.all(trName)[i]) document.all(trName)[i].className=className;
                        }     
                      }

}
